const fs = require('fs');
const data = require('./db.json');

console.log(data.heroList);

const result = [];

for(let i in data.heroList){
    result.push({...data.heroList[i],id: Number(data.heroList[i].heroId) });
}

let obj = {
    lol: result
}

fs.writeFileSync('./d.json', JSON.stringify(obj));